package com.longge;

public class FindTheDistanceValue {

    public int findTheDistanceValue(int[] arr1, int[] arr2, int d) {

        int ans = 0;
        for (int i = 0; i < arr1.length; i++) {
            for (int j = 0; j < arr2.length; j++) {
                int abs = Math.abs(arr1[i] - arr2[j]);
                if (abs <= d) break;
                if (j == arr2.length - 1) {
                    ans++;
                }
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        new FindTheDistanceValue().findTheDistanceValue(new int[]{4,5,8},new int[]{10,9,1,8},2);
    }
}
